import _ko = require('knockout');
import _app = require('durandal/app');
import _router = require('plugins/router');

export class Shell {
    constructor(private app: any, public router: any) {
    }

    public activate() {
        var routes = [
            { route: '', title: 'Trending', moduleId: 'trend', nav: true },
            { route: 'about', title: 'About', moduleId: 'about', nav: true },
            { route: 'discussion/:id', title: 'Discussion', moduleId: 'discussion', nav: false }
        ];

        return this.router.makeRelative({ moduleId: 'viewmodels' })
            .map(routes)
            .buildNavigationModel()
            .activate();
    }

    public search(): any {
        return _app.showMessage("Search is not implemented yet!", "Sorry");
    }
}

return new Shell(_app, _router);